package com.bw.producer.controller;

import com.bw.producer.Vo.ItemInfoVo;
import com.bw.producer.service.ItemDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("item")
@RestController
public class ItemDetailsController {
    @Autowired
    private ItemDetailsService itemDetailsService;


    /**
     * 详情项
     * @param skuId
     * @return
     */
    @GetMapping("details/{skuId}")
    public ItemInfoVo itemDetails(@PathVariable Long skuId){
        ItemInfoVo itemInfoVo = itemDetailsService.itemDetails(skuId);
        return itemInfoVo;
    }
}
